﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.Security;
using System.Web.UI;
using System.Web.UI.WebControls;

namespace HomeBuhApp.Account
{
	public partial class Registration : System.Web.UI.Page
	{
		protected override void OnLoad(EventArgs e)
		{
			base.OnLoad(e);

			UserRegistration.ContinueDestinationPageUrl = Request.QueryString["ReturnUrl"]==string.Empty? Request.QueryString["ReturnUrl"] : "~";
		}

		protected void UserRegistration_CreatedUser(object sender, EventArgs e)
		{
			FormsAuthentication.SetAuthCookie(UserRegistration.UserName, false);

			string continueUrl = UserRegistration.ContinueDestinationPageUrl;
			if (String.IsNullOrEmpty(continueUrl))
			{
				continueUrl = "~/";
			}
			Response.Redirect(continueUrl);
		}

	}
}